<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <include file="Public:header" />
</head>
<body>
  <include file="Public:body_top" />

  <div class="container-fluid">
    <div class="row">
      <div class="col-sm-3 col-md-2 sidebar hidden-xs">
        <div class="menu">
          <dl>
            <dt><i class="cm-order"></i>商品管理</dt>
            <dd><a href="{:U('Products/index')}">商品列表</a></dd>
          </dl>
          <dl>
            <dt><i class="cm-order"></i>商品库管理</dt>
            <dd><a href="{:U('Products/plat_index')}">商品库</a></dd>
            <dd><a href="{:U('Products/plat_cate_index')}">商品库分类</a></dd>
            <dd><a href="{:U('Products/plat_new_cate')}">新建商品分类</a></dd>
            <dd class="active"><a href="{:U('Products/plat_new_product')}">新建商品</a></dd>
          </dl>
        </div>
      </div>
      <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
        <div class="main-hd">
          <h5>新建商品</h5>
        </div>
        <div class="main-bd">
          <div class="form-box">
            <form class="form-horizontal" method="post" enctype="multipart/form-data" action="{:U('Products/plat_create_product')}">
              <div class="form-group">
                <label class="col-sm-2 control-label">商品名称</label>
                <div class="col-sm-4">
                  <input type="text" class="form-control" name="name" placeholder="请输入商品名称" required>
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-2 control-label">商品分类</label>
                <div class="col-sm-4">
                  <select name="product_cate_id" class="form-control">
                    <option>请选择分类</option>
                    <volist name="product_cates" id="vo">
                      <option value="{$vo.id}">{$vo.name}</option>
                    </volist>
                  </select>
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-2 control-label">商品价格</label>
                <div class="col-sm-4">
                  <input type="text" class="form-control" name="price" placeholder="请输入价格，例：9.9" required>
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-2 control-label">代理价格</label>
                <div class="col-sm-4">
                  <input type="text" class="form-control" name="proxy_price" placeholder="请输入价格，例：6.9" required>
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-2 control-label">库存</label>
                <div class="col-sm-4">
                  <input type="text" class="form-control" name="product_num" placeholder="请输入库存，例：9" required>
                </div>
              </div>

              <div class="form-group">
                  <label class="col-sm-2 control-label">限时入库</label>
                  <div class="col-sm-4">
                    <input class="form-control" id="datetime" type="text" placeholder="不填，则不限制限时入库" name="limit_depot" value="{$limit_depot}" id="limit_depot" readonly>
                  </div>
              </div>
 
              <div class="form-group">
                <label class="col-sm-2 control-label ">LOGO</label>
                <div class="col-sm-1">
                  <div class="uploadimg" id="uploadimg">
                    <i class="cm-plus"></i>
                    <img id="logo-preview" src="" alt="">
                    <input type="hidden" name="logo" id="logo-img">
                    <input type="file" style="display:none" name="photos[]" id="logo" data-id="ad-img" class="file-input">
                  </div>
                </div>
                <div class="col-sm-4">
                  <span class="tips logo" style="display:none"><br>上传中</span>
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-2 control-label ">商品轮播图</label>
                <div id="photos-preview">
                </div>

                <div class="col-sm-1">
                  <div class="uploadimg" id="uploadimg">
                    <i class="cm-plus"></i>
                    <input type="file" name="photos[]" id="photos" multiple data-id="ad-img" class="file-input">
                  </div>
                </div>
                <div class="col-sm-4">
                  <span class="tips photos" style="display:none"><br>上传中</span>
                  <span class="tips"><br>点击删除</span>
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-2 control-label">商品海报描述</label>
                <div class="col-sm-10">
                  <input type="text" class="form-control" name="descrip" value="{$product.descrip}" placeholder="建议在25字以内">
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-2 control-label">描述介绍</label>
                <div class="col-sm-10">
                  <textarea name="content" id="editor" rows="10" cols="80"></textarea>
                </div>
              </div>
              <div class="form-group">
                <div class="col-sm-offset-2 col-sm-10">
                  <input type="submit" class="btn btn-primary" value="提交">
                </div>
              </div>
            </form>
          </div>
        </div>
      </div>
    </div>
  </div>

<script>
      $('#datetime').datetimepicker({
        format: 'yyyy-mm-dd hh:ii',
        autoclose: true,
        todayBtn: true,
        language: 'zh-CN'
      });
      $("#datetime").on("dp.change", function(e) {
        $('#datetime').data("DateTimePicker").minDate(e.date);
      });
</script>
</body>
<include file="Public:upload" />

</html>